home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2000 #4 / Amiga Plus CD - 2000 - No. 4.iso / Tools / Text / HTML / HTMLEXT / GUI / func.mreplace < prev    next >
Text File  |  2000-04-17  |  6KB  |  212 lines

  1. G4C
  2. ; $VER: func.mreplace Rev.021 by Juan Manuel Wehrli 1999 - 2000
  3. WINBIG -1 -1 600 405 "Multi Suchen & Ersetzen"
  4. WinType 11010000
  5. WinBackground IMAGE BG 0
  6. Winout "NIL:"
  7. VarPath HTMLEXT
  8.  
  9. xOnLoad
  10.     SetGad #This 4 OFF
  11.     GuiOpen #This
  12.  
  13. xOnOpen
  14.     SetVar datpat "#?.htm"
  15.     ifexists file "HTMLEXT:Settings/mrep.prefs"
  16.         lvuse #This 1
  17.         lvchange "htmlext:Settings/mrep.prefs"
  18.     else
  19.         lvuse #This 1
  20.         lvchange "htmlext:Settings/defaults/MRep.prefs"
  21.         lvsave "htmlext:Settings/mrep.prefs"
  22.     endif
  23.     if $*was != ""
  24.         Update #This 3 $*was
  25.         SetVar was $*was
  26.     endif
  27.  
  28. xOnQuit
  29.     *string1 = $string1
  30.     *string2 = $string2
  31.     *was = $was
  32.  
  33. XLISTVIEW 5 5 590 305 "" repdb "htmlext:Settings/mrep.prefs" 0 SHOW
  34.     gadid 1
  35.     gadfont sgiscreen.font 13 000
  36.     EXTRACT %OLDSTRING CLEAN oldstring
  37.     Update #This 5 $oldstring
  38.     EXTRACT %NEWSTRING CLEAN newstring
  39.     Update #This 6 $newstring
  40.  
  41. xButton 5 310 35 18 "Neu"
  42.     GadFont xHelvetica.font 11 000
  43.     lvuse #This 1
  44.     lvadd ''
  45.     %OLDSTRING = "-Neuer Eintrag-"
  46.     %NEWSTRING = "-Neuer Eintrag-"
  47.     lvsort %OLDSTRING
  48.     lvsave "htmlext:settings/mrep.prefs"
  49.  
  50. xButton 40 310 50 18 "Ändern"
  51.     GadFont xHelvetica.font 11 000
  52.     lvuse #This 1
  53.     lvdel -1
  54.     lvadd ''
  55.     %OLDSTRING = $altbeg
  56.     %NEWSTRING = $neubeg
  57.     lvsort %OLDSTRING
  58.     lvsave "htmlext:settings/mrep.prefs"
  59.     Update #This 5 ""
  60.     Update #This 6 ""
  61.  
  62. xButton 90 310 50 18 "Löschen"
  63.     GadFont xHelvetica.font 11 000
  64.     GadKey "a"
  65.     lvuse #This 1
  66.     lvdel -1
  67.     lvsort %OLDSTRING
  68.     lvsave "htmlext:settings/mrep.prefs"
  69.  
  70. xButton 140 310 95 18 "Alles löschen"
  71.     GadFont xHelvetica.font 11 000
  72.     GadKey "a"
  73.     lvuse #This 1
  74.     lvclear
  75.     lvchange "htmlext:settings/defaults/MRep.prefs"
  76.     lvadd ''
  77.     %OLDSTRING = "[Neuer Eintrag]"
  78.     %NEWSTRING = "[Neuer Eintrag]"
  79.     lvsort %OLDSTRING
  80.     lvsave "htmlext:settings/mrep.prefs"
  81.  
  82. TEXT 295 310 45 18 "Schema:" 20 NOBOX
  83.     GadFont xHelvetica.font 11 000
  84.  
  85. xButton 340 310 85 18 "Laden"
  86.     GadFont xHelvetica.font 11 000
  87.     reqFile -1 -1 300 600 "Schema laden ..." LOAD lschema "HTMLEXT:data/mrep/"
  88.     ifexists file $lschema
  89.         lvuse #This 1
  90.         lvchange $lschema
  91.         lvsave "htmlext:Settings/mrep.prefs"
  92.     endif
  93.  
  94. xButton 425 310 85 18 "Speichern als"
  95.     GadFont xHelvetica.font 11 000
  96.     reqFile -1 -1 300 600 "Schema speichern unter ..." SAVE sschema "HTMLEXT:data/mrep/"
  97.     lvuse #This 1
  98.     lvsave $sschema
  99.  
  100. xButton 510 310 85 18 "Löschen"
  101.     GadFont xHelvetica.font 11 000
  102.     reqFile -1 -1 300 600 "Schema speichern unter ..." LOAD dschema "HTMLEXT:data/mrep/"
  103.     ifexists file $dschema
  104.         delete $dschema
  105.     else
  106.         EZREQ "Schema konnte nicht gelöscht werden!" "Weiter" NIL
  107.     endif
  108.  
  109.  
  110. TEXT 8 330 45 15 "Suche nach:" 20 NOBOX
  111.     GadFont xHelvetica.font 11 000
  112.  
  113. xTextIn 5 345 220 18 "" altbeg "" 155
  114.     GadID 5
  115.     GadFont "xHelvetica.font" "11" 000
  116.  
  117.  
  118. TEXT 238 330 45 15 "Ersetze durch:" 20 NOBOX
  119.     GadFont xHelvetica.font 11 000
  120.  
  121. xTextIn 235 345 210 18 "" neubeg "" 155
  122.     GadID 6
  123.     GadFont "xHelvetica.font" "11" 000
  124.     lvuse #This 1
  125.     lvdel -1
  126.     lvadd ''
  127.     %OLDSTRING = $altbeg
  128.     %NEWSTRING = $neubeg
  129.     lvsort %OLDSTRING
  130.     lvsave "htmlext:settings/mrep.prefs"
  131.     Update #This 5 ""
  132.     Update #This 6 ""
  133.  
  134.  
  135. TEXT 8 365 220 15 "Datei Pattern: (gilt nur für Funktion 2)" 100 NOBOX
  136.     GadFont xHelvetica.font 11 000
  137.  
  138. xTextIn 5 380 220 18 "" datpat "#?.htm" 155
  139.     GadFont "xHelvetica.font" "11" 000
  140.  
  141. xCheckBox 575 345 18 18 "bak Dateien erzeugen" *bakfilestat "1" "0" OFF
  142.     GadID 4
  143.     GadHelp "Diese Funktion ist noch nicht implementiert!"
  144.     GadFont "xHelvetica.font" "11" 000
  145.  
  146. xButton 290 380 110 18 "_1 Selekt. ersetzen"
  147.     GadFont xHelvetica.font 11 000
  148.     GadKey "1"
  149.     Update "infobar" 1 "MultiReplace: Erstelle Dateiliste ..."
  150.     GuiWindow HTMLEXT WAIT
  151.     GuiWindow #This WAIT
  152.     cli 'delete t:htmlext/mrep.files'
  153.     cli 'delete t:htmlext/mrep.list'
  154.     LVUSE HTMLEXT 3
  155.     LVMulti First
  156.     while $$lv.line > ''
  157.         Joinfile $$lv.dir $$lv.rec aktfile
  158.         cli 'echo "$aktfile" >>t:htmlext/mrep.files'
  159.         LVUse HTMLEXT 3
  160.         LVMulti Off
  161.         LVMulti First
  162.     endwhile
  163.     Update "infobar" 1 "MultiReplace: Erstelle Replace Attributliste ..."
  164.     LVUSE #This 1
  165.     LVGO First
  166.     while $$lv.line > ''
  167.         Joinfile $$lv.dir $$lv.rec aktfile
  168.         cli 'echo "$%OLDSTRING @@ $%NEWSTRING" >>t:htmlext/mrep.list'
  169.         LVGO Next
  170.     endwhile
  171.     Update "infobar" 1 "MultiReplace: Ersetze ... bitte haben Sie Geduld ..."
  172.     lvuse HTMLEXT 3
  173.     LVMulti Show
  174.     GuiWindow HTMLEXT RESUME
  175.     GuiWindow #This RESUME
  176.     RUN 'rx htmlext:mod/htmlext.smod MREP'
  177.     GuiQuit #This
  178.  
  179. xButton 400 380 110 18 "_2 Alles inkl. U.Verz."
  180.     GadFont xHelvetica.font 11 000
  181.     GadKey "2"
  182.     Update "infobar" 1 "MultiReplace: Erstelle Dateiliste ..."
  183.     GuiWindow HTMLEXT WAIT
  184.     GuiWindow #This WAIT
  185.     cli 'delete t:htmlext/mrep.files'
  186.     cli 'delete t:htmlext/mrep.list'
  187.     LVUSE HTMLEXT 3
  188.     aktdir = $$lv.dir
  189.     cli 'list DIR $aktdir P="$datpat" lformat="%P%N" FILES ALL >>t:htmlext/mrep.files'
  190.     Update "infobar" 1 "MultiReplace: Erstelle Replace Attributliste ..."
  191.     LVUSE #This 1
  192.     LVGO First
  193.     while $$lv.line > ''
  194.         Joinfile $$lv.dir $$lv.rec aktfile
  195.         cli 'echo "$%OLDSTRING @@ $%NEWSTRING" >>t:htmlext/mrep.list'
  196.         LVGO Next
  197.     endwhile
  198.     Update "infobar" 1 "MultiReplace: Ersetze ... bitte haben Sie Geduld ..."
  199.     lvuse HTMLEXT 3
  200.     LVMulti None
  201.     LVMulti Show
  202.     GuiWindow HTMLEXT RESUME
  203.     GuiWindow #This RESUME
  204.     RUN 'rx htmlext:mod/htmlext.smod MREP'
  205.     GuiQuit #This
  206.  
  207. xButton 510 380 85 18 "[_X] Abbrechen"
  208.     GadFont xHelvetica.font 11 000
  209.     GadKey "x"
  210.     GuiQuit #This
  211.  
  212.